


	
	

	



	


<!-- alle inwendige aparte forms verbergen-->
	function hideAll(k) {
	  
	  $("#formTimePerCourse"+k).hide(); 
  	  $("#formTimevsIdeal"+k).hide(); 
  	  $("#formTopBuddies"+k).hide();
  	  $("#formTopPlaces"+k).hide();
  	  $("#formCourseDist"+k).hide(); 
  	  $("#formAvgRating"+k).hide();
  	  $("#formDayOfWeek"+k).hide();
  	  $("#formSchoolOther"+k).hide(); 
  	  $("#formOther"+k).hide(); 
      $("#avgTimePerCourse"+k).hide();
  	  
    }
	
	 <!-- tijd per vak -->
	  function updateChartTimePerCourse(form, dive, k){ 
		  
		  hide_settings(k); //kaderke verbergen
		  data = new google.visualization.DataTable();
   	  data.addColumn('string', 'Course');
         data.addColumn('number', 'Hours'); 
         
          i=0;
		    for (w = 0; w < form.elements.length; w++ ) {
		            if (form.elements[w].checked == true) {
		            	data.addRow();
		            	data.setCell( i , 0, form.elements[w].name);
		          	    data.setCell( i , 1, parseFloat(form.elements[w].value));
		          	    i++;
		            }
		        }
		    	    
		    if (i!=0){
		    typeOfChart = form.typeOfChart.value;
		    UpdateChart (typeOfChart, dive);
		    updateTitle(k,null);
		    }
		    else if (i==0){
		    	alert("U have to select at least 1 course.");	
		    } 
		  
     } 	

	  <!-- tijd vs ideale tijd -->  
		function updateChartTimevsIdeal(form, dive, k){ 
		
			  hide_settings(k); //kaderke verbergen
		
			  data = new google.visualization.DataTable();
			  var ideale=0;
			  var yourTime=0;

	    	  /* alert(form.typeOfChart.value);
	    	  alert(form.course.value);
	    	  alert(document.getElementById(form.course.value).value); */
	    	  
	    	  
	    	  ideale=parseFloat(document.getElementById(form.course.value).name);	
	    	  yourTime=parseFloat(document.getElementById(form.course.value).value);	
	    	  
			  typeOfChart = form.typeOfChart.value;
			  
		      if(typeOfChart=="0"){
		    	  data.addColumn('string', 'Your studytime');
		          data.addColumn('number', 'Your studytime'); 
		    	  data.addRows(2);
				  data.setValue(0, 0, 'Ideal studytime');
			      data.setValue(0, 1, ideale);
			      data.setValue(1, 0, 'Your studytime');
			      data.setValue(1, 1, yourTime);
			  }
			  else if(typeOfChart=="1"){ 
				  data.addColumn('number', 'Ideal studytime');
		          data.addColumn('number', 'Your studytime'); 
				  data.addRow();
				  data.setCell( 0 , 0, ideale);
		    	  data.setCell( 0 , 1, yourTime); 

			  }

			  UpdateChart (typeOfChart, dive);
			  updateTitle(k,form.course.value);

			  
	      } 
		
		
		<!-- course dist -->  
		function updateCourseDist(form, dive, k){ 
			
			hide_settings(k); //kaderke verbergen
			
			  data = new google.visualization.DataTable();
	    	  data.addColumn('string', 'Sort of activity');
	          data.addColumn('number', 'Hours'); 
	          data.addRows(3);

	    	  var names = document.getElementsByName(form.course.value);

			  typeOfChart = form.typeOfChart.value;

	    	  data.setCell( 0 , 0, 'Lesson'); 
	    	  data.setCell( 0 , 1, parseFloat(names[0].value));
	    	  data.setCell( 1 , 0, 'Exercise'); 
	    	  data.setCell( 1 , 1, parseFloat(names[1].value));
	    	  data.setCell( 2 , 0, 'Selfstudy'); 
	    	  data.setCell( 2 , 1, parseFloat(names[2].value));
	    	  
	          typeOfChart = form.typeOfChart.value;
			  UpdateChart (typeOfChart, dive); 
			  updateTitle(k,form.course.value);
	      } 
		
		
		
//	    function updateChartAvgRating(form, dive, k){ 
//			
//			hide_settings(k); //kaderke verbergen
//			
//			  data = new google.visualization.DataTable();
//	    	  data.addColumn('string', 'Vak');
//	          data.addColumn('number', 'Gemiddelde Rating'); 
//	          
//	          <%
//			  HashMap<String, Integer> avgRating = StatisticsController.getCourseAverageRating(currStud);
//			  %>
//	          
//			  inc=0;    	  
//	          <%
//	          Iterator it_avgRating = avgRating.entrySet().iterator();
//	          while (it_avgRating.hasNext()) {
//	    	  Map.Entry avgRating_pairs = (Map.Entry)it_avgRating.next();
//	    	  %> 	  
//	    	  data.addRow();
//	    	  data.setCell( inc , 0, '<%=avgRating_pairs.getKey()%>'); 
//	    	  data.setCell( inc , 1, <%=avgRating_pairs.getValue()%>);
//	    	  inc++;
//	    	  <%
//	          }
//	          %>
//	          typeOfChart = form.typeOfChart.value;
//			  UpdateChart (typeOfChart, dive); 
//			  updateTitle(k,null);
//	      } 